﻿using System.Collections.Generic;
using Xunit.Abstractions;

#if XUNIT_CORE_DLL

namespace Xunit.Sdk
#else
namespace Xunit
#endif
{
	internal class TestDiscoveryVisitor : TestMessageVisitor<IDiscoveryCompleteMessage>
	{
		public TestDiscoveryVisitor()
		{
			TestCases = new List<ITestCase>();
		}

		public List<ITestCase> TestCases { get; private set; }

		protected override bool Visit(ITestCaseDiscoveryMessage discovery)
		{
			TestCases.Add(discovery.TestCase);

			return true;
		}
	}
}